		var xmlhttp;
		function createXMLHTTPRequest()
		{
			if(window.XMLHttpRequest)
			{
				return new XMLHttpRequest();
			}
			else if(window.ActiveXObject)
			{
				return new ActiveXObject("Microsoft.XMLHTTP");
			}
		}
        function LayDanhMucCon(strURL)
		{
		//	$ab = '123';
		//	alert($ab);
			
				var url="ajax_LayDanhMucCon.php?ID=" + strURL;
	
				xmlhttp=createXMLHTTPRequest();
	
				xmlhttp.onreadystatechange=showDanhMuc;
				xmlhttp.open("get",url,true);
				xmlhttp.send(null);	
				

		}
		function showDanhMuc()
		{
			if(xmlhttp.readyState==4 && xmlhttp.status==200)
			{
				var div=document.getElementById("HienThi");
				div.innerHTML=xmlhttp.responseText;
				
			}
		}
		function HienThiDanhMucCon(strURL)
		{
			//$abc = strURL;
			//alert($abc);
			var url="HienThiDanhMuc.php?ID=" + strURL;
		//	alert(url);
			xmlhttp=createXMLHTTPRequest();

			xmlhttp.onreadystatechange=HienThiDanhMuc;
			xmlhttp.open("get",url,true);
			xmlhttp.send(null);	
		}
		
		function HienThiDanhMucCon1(strURL)
		{
			//$abc = strURL;
		//	alert($abc);
			var url="HienThiMucCon.php?ID=" + strURL;
		//	alert(url);
			xmlhttp=createXMLHTTPRequest();

			xmlhttp.onreadystatechange=HienThiMucCon;
			xmlhttp.open("get",url,true);
			xmlhttp.send(null);	
		}
		function HienThiDanhMuc()
		{
			if(xmlhttp.readyState==4 && xmlhttp.status==200)
			{
				var div=document.getElementById("DanhMucConCap1");
				div.innerHTML=xmlhttp.responseText;
				
			}
		}
		
		function HienThiMucCon()
		{
			if(xmlhttp.readyState==4 && xmlhttp.status==200)
			{
				var div=document.getElementById("DanhMucCon2");
				div.innerHTML=xmlhttp.responseText;
				
			}
		}
	
		function CapNhat()
		{
		//	alert("abc");
			$MucCha = document.getElementById("DanhMucCha").value;
			$MucCon1 = document.getElementById("DanhMucCon").value;
			$MucCon2 = document.getElementById("DanhMucCon1").value;
			var TenDanhMuc = document.getElementById('DanhMucDangChon').value;
			//$abc = $MucCha + $MucCon1 +$MucCon2 +TenDanhMuc;
			//alert("dang bao loc");
			if(TenDanhMuc !='')
			{
				if($MucCon2 !='MucCon2')
				{
						alert("cap nhat thang chau");
					var url="CapNhat.php?MucCha=" + $MucCha + "&MucCon1=" + $MucCon1 + "&MucCon2=" + $MucCon2 + "&TenDanhMuc=" + TenDanhMuc ;
				}
				else
				{
					if($MucCon1 !='MucCon1')
					{
						alert("cap nhat thang con");
						var url="CapNhat1.php?MucCha=" + $MucCha + "&MucCon1=" + $MucCon1 + "&TenDanhMuc=" + TenDanhMuc ;
					}
					else
					{
						if($MucCha !='MucCha')
						{
							alert("Cap nhat thang cha");
							var url="CapNhat2.php?MucCha=" + $MucCha + "&TenDanhMuc=" + TenDanhMuc ;
						}
					}
				}
				xmlhttp=createXMLHTTPRequest();
				if($MucCon2 !='MucCon2')
				{
					alert("chau");
					xmlhttp.onreadystatechange=CapNhatDanhMuc;
				}
				else
				{
					if($MucCon1 !='MucCon1')
					{
						alert("con");
						xmlhttp.onreadystatechange=CapNhatDanhMuc1;
					}
					else
					{
						alert("Toi day roi");
						xmlhttp.onreadystatechange=CapNhatDanhMuc2;
					}
				}
				xmlhttp.open("get",url,true);
				xmlhttp.send(null);	
			}
			else
			{
				alert("Vui long go noi dung can cap nhat !");
			}
		}
		
		function CapNhatDanhMuc()
		{
			if(xmlhttp.readyState==4 && xmlhttp.status==200)
			{
				var div=document.getElementById("DanhMucConCap1");
			//	var div=document.getElementById("HienThi");
				div.innerHTML=xmlhttp.responseText;
				
			}
		}
		function CapNhatDanhMuc1()
		{
			if(xmlhttp.readyState==4 && xmlhttp.status==200)
			{
				var div=document.getElementById("HienThi");
				div.innerHTML=xmlhttp.responseText;
				
			}
		}
		function CapNhatDanhMuc2()
		{
			if(xmlhttp.readyState==4 && xmlhttp.status==200)
			{
				var div=document.getElementById("DanhMucCha");
				div.innerHTML=xmlhttp.responseText;
			}
		}